Can anyone please help me? I need to add arrows to my JavaScript submenu to indicate that one of my submenu items have a child menu with options.
How can I do that in JavaScript without inserting graphics? I only need to show like a > greater than symbol or something like that.
11 2698
Post your current code, so that we can work with that.
Post your current code, so that we can work with that.
Hi Acoder and thanks for your quick reply,
Here is where I have each submenu defined: - if (!exclude) { //********
-
//************************
-
-
-
// *** POSITIONING AND STYLES *********************************************
-
-
-
var menuALIGN = "center"; // alignment
-
var absLEFT = 0; // absolute left or right position (if not center)
-
var absTOP = 128; // absolute top position
-
-
var staticMENU = false; // static positioning mode (ie5/6 and ns4 only)
-
-
var stretchMENU = false; // show empty cells
-
var showBORDERS = false; // show empty cell borders
-
-
var baseHREF = "resources/";
-
var zORDER = 1000; // base z-order of nav structure (not ns4)
-
-
var mCOLOR = "#339999"; // main nav cell color
-
var rCOLOR = "#006666"; // main nav cell rollover color
-
var keepLIT = true; // keep rollover color when browsing menu
-
var bSIZE = 1; // main nav border size
-
var bCOLOR = "#006666" // main nav border color
-
var aLINK = "#FFCC00"; // main nav link color
-
var aHOVER = "#FFFF99"; // main nav link hover-color (dual purpose)
-
var aDEC = "none"; // main nav link decoration
-
var fFONT = "Verdana,Tahoma,Helvetica"; // main nav font face
-
var fSIZE = 11; // main nav font size (pixels)
-
var fWEIGHT = "bold" // main nav font weight
-
var tINDENT = 7; // main nav text indent (if text is left or right aligned)
-
var vPADDING = 2; // main nav vertical cell padding
-
var vtOFFSET = 0; // main nav vertical text offset (+/- pixels from middle)
-
-
var vOFFSET = -5; // shift the submenus vertically
-
var hOFFSET = 4; // shift the submenus horizontally
-
-
var smCOLOR = "#339999"; // submenu cell color
-
var srCOLOR = "#006666"; // submenu cell rollover color
-
var sbSIZE = 1; // submenu border size
-
var sbCOLOR = "006666" // submenu border color
-
var saLINK = "#FFCC00"; // submenu link color
-
var saHOVER = "#FFFF99"; // submenu link hover-color (dual purpose)
-
var saDEC = "none"; // submenu link decoration
-
var sfFONT = "Verdana,Tahoma,Helvetica";// submenu font face
-
var sfSIZE = 11; // submenu font size (pixels)
-
var sfWEIGHT = "normal" // submenu font weight
-
var stINDENT = 5; // submenu text indent (if text is left or right aligned)
-
var svPADDING = 2; // submenu vertical cell padding
-
var svtOFFSET = 0; // submenu vertical text offset (+/- pixels from middle)
-
-
var shSIZE = 0; // menu drop shadow size
-
var shCOLOR = "#"; // menu drop shadow color
-
var shOPACITY = 75; // menu drop shadow opacity (not ie4/ns4/op5)
-
-
var keepSubLIT= true; // keep submenu rollover color when browsing child menu
-
var chvOFFSET = -3; // shift the child menus vertically
-
var chhOFFSET = -5; // shift the child menus horizontally
-
-
var closeTIMER = 330; // menu closing delay time
-
-
var cellCLICK = true; // links activate on TD click
-
var aCURSOR = "hand"; // cursor for active links (not ns4 or op5)
-
-
var altDISPLAY = "title"; // where to display alt text
-
var allowRESIZE=true; // allow resize/reload
-
-
-
//** LINKS ***********************************************************
-
-
-
// add main link item ("url","Link name",width,"text-alignment","_target","alt text",top position,left position,"key trigger")
-
addMainItem("index.htm","Home",65,"center","","home",0,0,"");
-
-
addMainItem("","Facts",65,"center","","",0,0,"");
-
-
defineSubmenuProperties(170,"left","left",0,0);
-
-
addSubmenuItem("general.htm","General info","","");
-
addSubmenuItem("quick.htm","A quick glance","","");
-
addSubmenuItem("curriculum.htm","curriculum","","");
-
// HERE IS WHERE I DEFINE THE CHILD MENU
-
defineChildmenuProperties(164,"left","center",0,0);
-
addChildmenuItem("http://www.example.com","Escuela Internacional","","");
-
-
// END OF FIRST CHILD MENU
-
-
addSubmenuItem("history.html","History","","");
-
addSubmenuItem("newsletter_latest.php","Read latest newsletter","","");
-
addSubmenuItem("newsletter_all.php","Read all newsletters","","");
-
addSubmenuItem("announcement_all.php","Read all announcements","","");
-
-
-
addMainItem("","Administration",110,"center","","",0,0,"");
-
-
defineSubmenuProperties(180,"left","left",0,0);
-
-
addSubmenuItem("staff2005.htm","Staff introduction 2005-2006","","");
-
addSubmenuItem("staff.htm","Staff introduction 2006-2007","","");
-
addSubmenuItem("directors.htm","Board of directors","","");
-
-
addMainItem("","Admission",80,"center","","",0,0,"");
-
-
defineSubmenuProperties(150,"left","left",0,0);
-
-
addSubmenuItem("registration.htm","Policy and registration","","");
-
addSubmenuItem("fees.htm","Tuition and fees","","");
-
addSubmenuItem("forms.htm","Download forms","","");
-
addSubmenuItem("scholarship.htm","Scholarship","","");
-
-
addMainItem("","Associations",92,"center","","",0,0,"");
-
-
defineSubmenuProperties(170,"left","right",0,0);
-
-
addSubmenuItem("assoc.htm","PTA, SACS, Student Council","","");
-
-
addMainItem("","Calendar",80,"center","","",0,0,"");
-
-
defineSubmenuProperties(80,"center","left",0,0);
-
-
addSubmenuItem("calendar2006.htm","2006 - 2007","","");
-
addSubmenuItem("calendar2007.htm","2007 - 2008","","");
-
-
-
addMainItem("","Employment",92,"center","","",0,0,"");
-
-
defineSubmenuProperties(150,"left","left",0,0);
-
-
addSubmenuItem("opportunities.htm","opportunities","","");
-
addSubmenuItem("benefit.htm","teacher benefit package","","");
-
addSubmenuItem("application.asp","application","","");
-
addSubmenuItem("application.htm","job application form","","");
-
-
-
addMainItem("","Pictures",80,"center","","",0,0,"");
-
-
defineSubmenuProperties(80,"left","left",0,0);
-
-
addSubmenuItem("campus.htm","campus","","");
-
addSubmenuItem("activieties.htm","activities","","");
-
-
-
addMainItem("","Contact",80,"center","","",0,0,"");
-
-
defineSubmenuProperties(80,"right","left",0,0);
-
-
addSubmenuItem("contact.htm","contact info","","");
-
-
-
//**DO NOT EDIT THIS *****
-
}//***********************
-
//************************
Can you not just add it manually using >?
If not, you'll need to show the code for adding the sub menu.
Can you not just add it manually using >?
If not, you'll need to show the code for adding the sub menu.
Hi Acoder,
What do you mean with >
Can you not just add it manually using >?
If not, you'll need to show the code for adding the sub menu.
Ok, let's see. I have this other program that works with the other one and this is where I define all of my functions. Is it this what you need? - var exclude=true; var agt=navigator.userAgent.toLowerCase();
-
var ie=false; var ie4=false; var ie5=false; var op5=false; var konqi=false;
-
if (document.all&&(agt.indexOf('msie')!=-1)) {
-
ie=true; ie4=true; exclude=false;
-
if (agt.indexOf('msie 4')==-1) { ie5=true; ie4=false; }
-
if (agt.indexOf('opera')!=-1) { ie=false; ie4=false; ie5=false; op5=true; }
-
}
-
var ns6=false; var mz7=false;
-
if (document.getElementById&&!ie) {
-
ns6=true; exclude=false;
-
if (agt.indexOf('netscape6')==-1) {
-
ns6=false; mz7=true;
-
}
-
if (window.opera) { mz7=false; op5=true;}
-
else if (agt.indexOf('gecko')==-1) { mz7=false; exclude=true; }
-
}
-
if (agt.indexOf('opera 4')!=-1) { op5=false; mz7=false; exclude=true; }
-
var ns4=false;
-
if ((agt.indexOf('mozilla')!=-1)&&(parseInt(navigator.appVersion)>=4)&&!ie&&!op5&&!ns6&&!mz7) {
-
ns4=true; exclude=false;
-
}
-
if (agt.indexOf('webtv')!=-1) { ie=false; ie4=false; exclude=true; }
-
var win=true; var mac=false;
-
if (agt.indexOf('mac')!=-1) { win=false; mac=true; }
-
//djochange - added the following code to find Konqueror
-
if (navigator.vendor){
-
if (navigator.vendor =="KDE") {
-
ie=false;
-
ie4=false;
-
ie5=false;
-
konqi = true;
-
ns6=true;
-
ns4 = false;
-
exclude = false;
-
-
// exclude earlier than kde2.2
-
var thisKDE=agt;
-
var splitKDE=thisKDE.split("konqueror/");
-
var aKDE=splitKDE[1].split("; ");
-
var KDEn=parseFloat(aKDE[0]);
-
var oldKde=false;
-
if(KDEn<2.2){oldKde=true;exclude=true;ns6=false;konqi=false;}
-
}
-
}
-
//end djochange
-
// differentiate between opera 5 and 6
-
var op6=false;
-
if(op5){
-
if((agt.indexOf("opera 6")!=-1)||(agt.indexOf("opera/6")!=-1)){op6=true;op5=false;}
-
}
-
-
-
// array building functions for custom.js
-
var mu="mu";var m=0;var sm=0;var cm=0;var sp=0;
-
var mI=new Array;
-
var sP=new Array;
-
var sI=new Array;
-
var cP=new Array;
-
var cI=new Array;
-
-
function addMainItem(ma,mb,mc,md,me,mf,mg,mh,mi){
-
sm=0;
-
if(!mb||mb==""){mb=" ";}
-
while(mb.indexOf('<BR>')!=-1){mb=mb.replace('<BR>','<br>');}
-
if (!me||me==""){me="_self";}
-
if (!mf||mf==""||altDISPLAY==""){mf="none";}
-
if(!mg){mg=0;}if(!mh){mh=0;}
-
if(!mi||mi==""||mi=="c"||mi=="C"){mi="-";}
-
if(mi!="-"){mi=mi.toLowerCase();}
-
mI[m]=new Array(ma,mb,mc,md,me,mf,mg,mh,mi);
-
m++;
-
}
-
-
function defineSubmenuProperties(spa,spb,spc,spd,spe){
-
if(!spd){spd=0;}
-
if(!spe){spe=0;}
-
sP[(m-1)]=new Array(spa,spb,spc,spd,spe);
-
if (sm==0){
-
sI[(m-1)]=new Array; cP[(m-1)]=new Array; cI[(m-1)]=new Array;
-
}
-
}
-
-
function addSubmenuItem(sma,smb,smc,smd){
-
cm=0;var sme=true;
-
if(sme&&sma=="~"){sme=false;sma="";}
-
if (!sma||sma==""){sma="#";}
-
if (!smb||smb==""){smb=" ";}
-
while(smb.indexOf('<BR>')!=-1){smb=smb.replace('<BR>','<br>');}
-
if (!smc||smc==""){smc="_self";}
-
if (!smd||smd==""||altDISPLAY==""){smd="none";}
-
sI[(m-1)][sm]=new Array(sma,smb,smc,smd,sme);
-
sm++;
-
}
-
-
function defineChildmenuProperties(cpa,cpb,cpc,cpd,cpe){
-
if(!cpd){cpd=0;}
-
if(!cpe){cpe=0;}
-
cP[(m-1)][(sm-1)]=new Array(cpa,cpb,cpc,cpd,cpe);
-
cI[(m-1)][(sm-1)]=new Array;
-
}
-
-
function addChildmenuItem(cma,cmb,cmc,cmd){
-
var cme=true;
-
if(cma&&cma=="~"){cme=false;cma="";}
-
if (!cma||cma==""){cma="#";}
-
if (!cmb||cmb==""){cmb=" ";}
-
while(cmb.indexOf('<BR>')!=-1){cmb=cmb.replace('<BR>','<br>');}
-
if (!cmc||cmc==""){cmc="_self";}
-
if (!cmd||cmd==""||altDISPLAY==""){cmd="none";}
-
cI[(m-1)][(sm-1)][cm]=new Array(cma,cmb,cmc,cmd,cme);
-
cm++;
-
}
-
// custom upgrade backup definitions
-
var keepSubLIT=true;var chvOFFSET=0;var chhOFFSET=-5;var closeTIMER=330;var cellCLICK=true;var aCURSOR="hand";
-
var altDISPLAY="";var allowRESIZE=true;
OH MY GOOD,
Nobody can help?
Hi Acoder,
What do you mean with >
> is a HTML character entity for "greater than" or > (see link).
Hi Acoder,
I try the $gt; but when I upload the program I can only see two options of my menu and I can't see the others.
This is where I place the option: - addSubmenuItem("registration.htm","Policy and Registration &gt;","","");
So do you get an error? If so, what's the error?
Please use code tags when posting code:
[CODE=javascript]
JavaScript code here.
[/code]
Hi again Acoder,
Is working now, I think I did something wrong.
Now what I'd like to know is how can I make this > go at the end.
For example, if I have a submenu like this:
Vision >
I need the symbol to be at the end, having all the spaces in between the word Vision and the symbol. Do I need to add spaces? How can I do that?
You could add spaces using but you probably wouldn't be able to align it correctly. You're better off right-aligning it while the text is left-aligned. You could use tables or CSS.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Benoit |
last post by:
Here is a quick view of what my program is doing:
I am using a system hook to add a menu inside the system menu of my
Internet Explorer. Everything seems to work fine for now , my submenu
is...
|
by: Stefan |
last post by:
I'd like to display the keyboard navigation indicators in my C#
application without the user having to press the Alt key and regardless
of the machines global setting (Hide keyboard navigation...
|
by: jeff.perreault |
last post by:
I have a problem with a skmMenu submenu and I think it has to do with
an IIS Setting.
I have the same website set up on two servers -
One is MS 2003, the other is MS 2003 R2
If I load the web...
|
by: Jonathan |
last post by:
Hello All,
I am in the process of creating a 2/3 level collapsible/exspanible menu
(called "nav") where users can click on a category and have the
submenus appear beneath it and so on (allow...
|
by: Denburt |
last post by:
This code is for a Toggle Button layout on a form, with this code you can set a number of toggle buttons visible and have multiple submenus that will stay hidden when not in use. My main menu is set...
|
by: az538 |
last post by:
Hello All,
I am having a problem with my menu and submenu system. It works like a champ in IE6 and Firefox but IE7 renders the submenus in incorrect positions on the page. Also, the menu system...
|
by: jobs |
last post by:
On the asp.net 2.0 menu control under vs 2005.
Any way to remove that black arrow on menu items that have a submenu?
Any way to equally size menu items dispite text site of menu item?
Thanks...
|
by: bhosalevivek |
last post by:
I did this code from Dynamic Drive DHTML. it's working properly, but now I need submenu for "Submenu 1.2", means when I take mouse on "Submenu 1.2" I need to display "Submenu 1.2.1". I try to do...
|
by: oll3i |
last post by:
i have written css tab menu
but my links in submenu inherit the style of a href in main menu (#menu ul li a)?
when i hover over the links in submenu they do change as i want them to change they...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |